Expert Mode: Programs Before Settings
Define what programs will run before and/or after the profile runs.
You have the option of running an external program before the profile starts and/or after the profile has finished. This useful option allows you to prepare the files being copied before the profile has run, for example. There are many possible uses for these settings in SyncBackSE, so read through the following and consider how they may be applied to your own computer setup.
· | Run before profile: To have a program run before the profile is run, type the name into 'Run before profile' edit-box or click the folder icon next to it. For example, you could type notepad.exe so whenever the profile starts Notepad will be run. |
· | Wait until the program has finished before running profile: If this option is enabled, then when the program is run, SyncBackSE will pause the profile until the program has finished. The program must exit/close before the profile will continue. If you do not enable this option then the program will be run and the profile will carry on running without waiting for it to finish. |
· | Wait for a maximum of...: If this option is enabled, then you can choose how long SyncBackSE should wait for the program to finish before it continues. If the program does not finish within the specified time then SyncBackSE will continue with the profile. Note that it is advisable to set a maximum waiting time otherwise SyncBackSE may get "stuck" waiting for a program that is not going to exit. |
· | Abort the profile if the program fails to execute: If enabled, and the before program fails to start (because the program doesn't exist or cannot be run), then the profile will not run. By default the profile will continue to run with a failure. |
· | Abort the profile if the programs return value is not à: Most programs, batch files, and scripts, have a numeric return/exit value. This usually indicates if it ran without error, and if there was an error, what kind of error occurred. If you tick this checkbox then you can specify which return values the program must return for the profile to be run. A comma-delimited list of values can be entered, and a hyphen used to specify a range of values. For example, if the program returns 0, 1, or a value between 10 and 50 (inclusive) if it was run successfully, and any other value on failure, then in the edit box you would type 0, 1, 10-50. |
· | Run the program when simulating: By default the program is not run when doing a simulated run. This is advisable as the program may change or delete files, which is not something you generally want to do during a simulated run. |
Note that if the program name, or the folder it is in, contains spaces then you must wrap the entire program name with double-quotes otherwise the return value will always be 1. For example, C:\Program Files\Company Name\A Program.exe must be specified as "C:\Program Files\Company Name\A Program.exe". Any parameters passed to the program should also be wrapped in their own pair of double-quotes, especially if they contain spaces, e.g. "C:\Program Files\Company Name\A Program.exe" "param 1" "another param" |
As with the Source/Left and Destination/Right directories, you can use Windows environment variables. For example, if you typed ôNotepad %HOMEPATH%\test.txtö then this would run notepad and open a file in your home directory called test.txt. You can see a list of what typical Windows environment variables are available on the following web page:
http://www.winnetmag.com/Article/ArticleID/23873/23873.html
By default all external programs are run in a normal window. You can have the program instead run minimized so that they do not appear as a window on the screen. To do this prefix the program with one of the following:
/min This will run the program minimized and will not make it the currently active window. For example: /min "C:\Program Files\Company Name\A Program.exe"
/hide This will run the program minimized and will also hide the window. For example: /hide "C:\Program Files\Company Name\A Program.exe"
Unlike the Source/Left and Destination/Right directories, you can also use special SyncBackSE variables. These are used in the same way as environment variables, except they have a leading underscore character, e.g. %_Source%. The value returned is for the profile being run. Below is a list of the most common variables that you can use:
_Compression = Returns 1 if the destination/right is compressed
_Destination = Destination/right directory/filename
_DestIsFTP = Returns Y if the destination/right is an FTP server
_Priority = Run priority of the profile
_SingleFile = Returns 1 if compressing to a single file (ignore if _Compression returns 0)
_Source = Source/left directory
For a full list see the profile settings INI file.
All Content: 2BrightSparks Pte Ltd ⌐ 2003-2006